#include"myhead.h"

#define DISP_BUF_SIZE (1200 * 600)

typedef struct {
    lv_obj_t *ta;   // 输入框对象
    char *txt;      // 原始传入的 txt
} add_picture_data_t;


extern lv_obj_t *mybox;
extern int num;
extern char old_str[64];
extern lv_font_t *chinese_font;
extern lv_obj_t *dropdown_place; //下拉菜单

#define MAX_USER_NUM 1000
extern user users[MAX_USER_NUM];
extern int save;
extern lv_obj_t *msgbox;
extern lv_obj_t *orig_scr;  // 获取当前正在显示的屏幕
extern lv_obj_t *kb;
lv_obj_t *kb3_1;
extern lv_obj_t *add_picture_page;
extern lv_obj_t *add_picture_file_path_use;
static void pwd_eye_event_cb(lv_event_t * e);
static void change_user_event_cb(lv_event_t *e);

extern place_count;
extern PlaceMap place_map[];

void create_page_admin();//管理员
void create_page1(void);
extern void create_page1_ui();
extern void set_time(void);
extern void create_page_admin(void);
extern void return_admin_page2(lv_event_t *e);
void create_page_admin_2();
extern int set_file_flag(const char *filename,int newflag);
extern void add_picture_ways(char *txt);
extern bool file_exists_in_dir(const char *dir_path,const char *filename);
extern void return_add_picture_page(lv_event_t *e);
extern void return_add_picture_page1(lv_event_t *e);

extern void hide_kb_on_click(lv_event_t * e);
extern void setup_hide_kb(lv_obj_t * kb);
extern void ta_event_hide_cb_admin_1(lv_event_t *e);
extern void ta_event_cb3_1(lv_event_t *e);

void return_main_page(lv_event_t *e);
void set_time();
void btn_event_cb(lv_event_t *e);
void btn1_event_cb(lv_event_t *e);
void ta_event_cb(lv_event_t *e);
void timer_cb(lv_timer_t *timer);
void show_image_auto(const char *path);
void create_ui(void);
void timer_cb(lv_timer_t *timer);
void show_image_fs(void);
//file io
void get_user_file(void);
void push_user_file(user u);
static void mbox_ok_event_cb(lv_event_t * e);
void delete_user_event_cb(lv_event_t *e);
void delete_user(const char *username);
void ta_event_hide_cb1(lv_event_t *e);
void ta_event_cb3(lv_event_t *e);
static void create_admin_recommend_ui();
static void admin_dropdown_event_cb(lv_event_t *e) ;
void show_recommend_image(const char *place_name) ;

extern void enable_chinese_input(lv_obj_t *ta);